Resource Delivery

ABSTRACT

Methods, systems, and apparatus, including computer programs encoded on a computer storage medium, for delivering resources. The methods, systems, and apparatus include actions of based on measurements of amounts of a resource that are delivered from one or more supply outlets against amounts of value of electronic prepayments that have been authorized by corresponding users of mobile devices for the delivery of the resource at the one or more supply outlets, causing the one or more supply outlets to enable delivery of the resource in aggregate amounts that are not outside amounts of value of electronic prepayments that have been authorized by the corresponding users of mobile devices for the delivery of the resource.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a continuation application of U.S. application Ser.No. 15/235,729, filed on Aug. 12, 2016, which claims benefit of priorU.S. Provisional Application 62/210,541, filed on Aug. 27, 2015, whichare incorporated by reference in their entirety.

TECHNICAL FIELD

This disclosure generally relates to delivering resources.

BACKGROUND

Resources may be delivered by resource providers. For example, waterutilities may provide water to homes through water pipes. Users may thenbe charged for resources delivered by the resource providers. Forexample, water utilities may charge home owners on a monthly basis forwater delivered to the home. In other cases, resource providers mayprovide resources to a point of delivery after users insert tokensassociated with prepayment for resources into a meter at the point ofdelivery.

SUMMARY

In general, an aspect of the subject matter described in thisspecification may involve a system for delivering resources. In much ofthe developing world, the urban poor face the daily challenge ofprocuring water. Many cannot pay monthly bills and high upfrontconnection costs due to their irregular incomes. They turn tosubstitutes such as public water points, delivery services and chlorinepills, which can be up to 15 times more expensive than utility pipedwater, and are often low quality and unreliable. Women and girls aremost affected, spending over 200 million hours fetching water annually,with 443 million school days being lost due to illness. Globalurbanization trends will only exacerbate the strain on water utilityinfrastructure, with African cities alone growing by 5% every year.

A system for delivering resources may help provide resources. Forexample, the system may help bring piped water to homes. The system mayhelp provide resources by reducing costs of billing and delinquenciesfor resource providers. For example, the system may reduce costs ofbilling and delinquencies for water utilities. The system may reducecosts and delinquencies by enabling micro-prepayments for resources. Forexample, the system may enable a user to use a mobile phone to prepay $1for a thousand gallons of water to be received through a water pipe atthe user's home and stop providing piped water once a prepaid amount ofwater has been delivered.

The system may enable micro-prepayments for resources through adistributed architecture including a central server (or servers), one ormore intermediate gateways in communication with the central server overwireless connections that incur cellular network charges, and supplyoutlets each located in a home or other resource supply location andeach in communication with an intermediate gateway over a connection(e.g., a wireless connection) that does not incur a cellular networkcharge. These supply outlets may regulate an amount of resources thatare provided to the home. For example, a water meter may only allow upto a pre-paid amount of water to flow from a water pipe, all whileallowing the user to determine when, how frequently, and over which timeperiod no more than the total prepaid amount of water is drawn from thesupply outlet. The supply outlets may be battery powered orself-powered, e.g., solar powered or hydro powered, and receiveprepayment order information from the intermediate gateways. Forexample, the supply outlets may be powered by AA batteries or otherkinds of batteries and receive prepayment order information (forexample, the amount of water that can be dispensed for the amount of aprepayment) from the intermediate gateways through transceiversoperating in industrial, scientific and medical (ISM) radio frequencybands.

The intermediate gateways may each provide prepayment order informationto a corresponding set of supply outlets associated with theintermediate gateway and may in turn receive prepayment orderinformation from a central server with respect to the supply outletsserved by that intermediate gateway. For example, an intermediategateway may provide prepayment order information for a set of onehundred supply outlets in a first neighborhood through transceiversoperating on ISM radio frequency bands, another intermediate gateway mayprovide prepayment order information for a set of two hundred supplyoutlets in a second neighborhood through transceivers operating on ISMradio frequency bands, and both of the intermediate gateways may receiveprepayment order information from a central server through 3Gtransceivers.

The central server may generate prepayment order information in responseto receiving prepayments for corresponding accounts through one or moreelectronic payment services. For example, the central server may receivea prepayment of $1 from the electronic payment service for a user, andin response, generate prepayment order information of a thousand gallonsof water to be credited to the user. Accordingly, the system may providea low cost approach for resources to be delivered.

In some aspects, the subject matter described in this specification maybe embodied in methods that may include the actions of, based onmeasurements of amounts of a resource that are delivered from one ormore supply outlets against amounts of value of electronic prepaymentsthat have been authorized by corresponding users of mobile devices forthe delivery of the resource at the one or more supply outlets, causingthe one or more supply outlets to enable delivery of the resource inaggregate amounts that are not outside amounts of value of electronicprepayments that have been authorized by the corresponding users ofmobile devices for the delivery of the resource.

In some aspects, the subject matter described in this specification maybe embodied in methods that may include the actions of receiving from anelectronic payment service a payment of monetary value that has beenauthorized at a mobile device, the monetary value to be used to pay foran amount of a resource to be dispensed at a supply outlet, and, basedon the monetary value, electronically sending one or more commands tocause a supply outlet to enable the dispensing of the amount of theresource at the supply outlet.

In some aspects, the subject matter described in this specification maybe embodied in methods that may include the actions of distributing froma central server through a cellular network to gateways, commands tocontrol water supply outlets to enable the dispensing of water atdistributed geographic locations, the commands being distributed fromeach of the gateways to a corresponding subset of the water supplyoutlets using a communication network different than the cellularnetwork.

In some aspects, the subject matter described in this specification maybe embodied in methods that may include the actions of receiving at acentral server through a cellular network from intermediary gateways,water flow volume information metered at individual water supply outletsat which water is dispensed to end users at distributed geographiclocations, the water flow information having been collected at each ofthe intermediary gateways from a corresponding subset of the watersupply outlets using a communication network the use of which does notincur a cellular network charge.

In some aspects, the subject matter described in this specification maybe embodied in methods that may include the actions of receiving from anelectronic payment service a payment of monetary value authorized from amobile device for an amount of a resource to be dispensed to a user,based on the receipt of the payment, electronically sending one or morecommands to cause a specific supply outlet to dispense the paid-foramount of the resource for the benefit of the user.

In some aspects, the subject matter described in this specification maybe embodied in an apparatus that includes a gateway for informationabout delivery of amounts of resources at supply outlets to consumersconsistent with values held in accounts. The gateway includes atransceiver to communicate with the supply outlets, one or moretransceivers to communicate on a communication network with the centralserver, and storage for (a) information that is received from thecentral server and is to be sent to the supply outlets to delivercontrolled amounts of the resources based on prepayments of value intothe accounts, and (b) resource delivery information that is receivedfrom the supply outlets and is to be sent to the central server.

In some aspects, the subject matter described in this specification maybe embodied in an apparatus that includes a gateway for informationabout water delivered at a set of water supply outlets at which water isdispensed to end users at distributed geographic locations. The gatewayincludes a transceiver to communicate wirelessly with the individualwater supply outlets, one or more transceivers to communicate wirelesslywith a central server, and storage for (a) commands received from thecentral server and to be sent to the individual water supply outlets todispense controlled amounts of water based on prepayments by end users,(b) water flow volume information received from the individual watersupply outlets and to be sent to the central server.

In some aspects, the subject matter described in this specification maybe embodied in an apparatus that includes a water supply outlet fordispensing water at a location. The water supply outlet includes a valvethat is controllable by a signal to dispense no more than a specificvolume of water at the location, a device to measure water flow volume,and a transceiver to communicate wirelessly through a network that doesnot incur a cellular network charge to receive one or more commandsgenerated by a central server to be used to cause the controlled volumeof water to be dispensed and to send water flow volume signals from themeasuring device for use at the central server.

Other versions include corresponding systems, apparatus, and computerprograms, configured to perform the actions of the methods, encoded oncomputer storage devices.

These and other versions may each optionally include one or more of thefollowing features. For instance, in some implementations, the resourceincludes one or more of water, a flowing resource, or domestic water. Insome aspects, the supply outlets include valve controls for water lines.In certain aspects, the supply outlets include water meters for waterlines. In some implementations, actions include receiving prepaymentsfrom an electronic payment system, where the prepayments each indicatean amount of value of electronic prepayment that has been authorized bya corresponding user of a mobile device for the delivery of the resourceat the one or more supply outlets.

In certain aspects, causing the one or more supply outlets to enabledelivery of the resource in aggregate amounts that are not outsideamounts of value of electronic prepayments that have been authorized bythe corresponding users of mobile devices for the delivery of theresource includes determining the amounts of resource for which toenable delivery based on the amount of value of electronic prepayment.In some aspects, causing the one or more supply outlets to enabledelivery of the resource in aggregate amounts that are not outsideamounts of value of electronic prepayments that have been authorized bythe corresponding users of mobile devices for the delivery of theresource includes providing the amount of resource to enable delivery.

In some implementations, mobile devices include one or more of non-smartphones, smart phones, tablet computers, or smart watches. In certainaspects, the gateway provides the resource delivery information to thecentral server when the gateway requests, from the central server,information to be sent to the supply outlets. In some aspects, thevalues held in accounts reflect an amount of a resource to provide. Insome implementations, the payment of the monetary value is authorized bythe user. In certain aspects, actions include determining the amount ofthe resource to be dispensed based on the monetary value.

In some aspects, the commands control on and off operation of valves atthe water supply outlets. In some implementations, the central serverprovides information indicating the water flow volume information tomobile devices of the end users. In certain aspects, the commandsinclude an order to increment an amount of water available to bedispensed from a particular water supply outlet by a particular amount.In some aspects, the storage is for (c) commands received from thecentral server and to be sent to the individual water supply outlets toprevent water supply outlets from dispensing water until another commandis sent to the individual water supply outlet to enable the water supplyoutlets to dispense water.

In some implementations, the water supply outlet includes amicrocontroller configured to manage energy consumption of the watersupply outlet based on turning off or depowering components of the watersupply outlet. In certain aspects, the microcontroller is configured tomanage energy consumption of the water supply outlet based ondetermining that water has not flowed through the device to measurewater flow volume for a predetermined length of time, and in response todetermining that water has not flowed through the device to measurewater flow volume for the predetermined length of time, causing thewater supply outlet to enter a deep sleep period in which one or morecomponents of the water supply outlet are turned off or depowered. Insome aspects, the water supply outlet includes a microcontroller thatdetermines the volume of water dispensed from the water supply outletusing non-floating point calculations.

The details of one or more implementations of the subject matterdescribed in this specification are set forth in the accompanyingdrawings and the description below. Other potential features, aspects,and advantages of the subject matter will become apparent from thedescription, the drawings, and the claims.

DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram of an example system for delivering resources.

FIGS. 2A and 2B are interaction diagrams of example interactions fordelivering resources.

FIG. 3 is a block diagram of an example water meter for deliveringwater.

FIG. 4 is a block diagram of an example intermediate gateway.

Like reference symbols in the various drawings indicate like elements.

DETAILED DESCRIPTION

FIG. 1 is a block diagram of an example system 100 for providingresources 101A-N (collectively referred to as 101). Briefly, and asdescribed in further detail below, the system 100 may include mobiledevices 102A-N (collectively referred to as 102), one or more electronicpayment system 110, a central server 120, intermediate gateways 130A-N(collectively referred to as 130), and supply outlets 140A-N(collectively referred to as 140).

The mobile devices 102 may be in communication with the one or moreelectronic payment systems 110 and the central server 120 throughwireless connections 160 and 162, respectively, which incur cellularnetwork charges, e.g., a 2G, 3G, or 4G network, or wireless connectionsthat does not incur a cellular network charge, e.g., Wi-Fi, or acombination of the two. The one or more electronic payment system 110may be in communication with the central server 120 through an Internetconnection 164, e.g., a wired or wireless connection. The central server120 may be in communication with remote intermediate gateways 130through wireless connections 166A-166N that incur a cellular networkcharges, e.g., a 2G, 3G, or 4G networks. Each of the intermediategateways 130 may be in communication with a set 142A, 142B of remotesupply outlets 140 through a wireless connection 168A-168N, for example,a wireless connection that does not incur a cellular network charge,e.g., ISM band based network.

As a range of wireless connections that do not incur a cellular networkcharge may be limited, the supply outlets 140 in each set of supplyoutlets 140 associated with each intermediate gateway 130 may be thosesupply outlets 140 that are in a particular geographical area in whichcommunications between the supply outlet and the intermediate gatewaymay be established. For example, the set 142A of the supply outletsincluding the supply outlet 140A and the supply outlet 140B may be thesupply outlets within a particular area in which communications betweenthe supply outlets 140A and 140B and the intermediate gateway 130A maybe established. In another example, the set 142B of the supply outletsincluding the supply outlet 140C and the supply outlet 140N may be thesupply outlets within a particular area in which communications betweenthe supply outlets 140C and 140N and the intermediate gateway 130B maybe established. Each intermediate gateway 130 may be associated with aset of supply outlets that are within a one hundred feet, one thousandfeet, one mile, or some other distance radius of the intermediategateway 130, or a set of supply outlets that are within some otherdefined geographic area.

The mobile devices 102 may enable users to provide prepaymentinstructions. The mobile devices 102 may be non-smart phones, smartphones, tablet computers, smart watches, or other devices. The mobiledevices 102 may enable users to provide prepayment instructions througha text interface, graphical user interface or voice interface or acombination of two or more of them. For example, the mobile devices 102may enable users to provide prepayment instructions through a text menuusing Short Messaging Service (SMS) or Unstructured SupplementaryService Data (USSD) messages. In another example, the graphical userinterface may include fields in which users may provide paymentinstructions for resources to be delivered or a voice interface mayinclude prompts in response to which users may provide paymentinstructions for resources to be delivered.

Each of the supply outlets 140 may be associated with a unique accountthat is associated with a unique identifier. For example, the supplyoutlet 140A may be associated with one account and the supply outlet140B may be associated with another account. Accordingly, in receivinginformation from a user for prepayment instruction, a mobile device mayreceive an indication of a particular supply outlet or a particularaccount that the payment will be credited towards. For example, the usermay enter a unique identifier for the unique account associated with thesupply outlet 140B to indicate that supply outlet 140B is to be crediteda particular prepayment. Using the mobile devices 102, a single user mayprovide prepayment instructions for multiple supply outlets. Forexample, a single user may provide prepayments instructions for thesupply outlet 140A and the supply outlet 140C by entering a uniqueidentifier for an account associated with the account supply outlet 140Afor a first prepayment instruction and later entering a uniqueidentifier for an account associated with the supply outlet 140C for asecond prepayment instruction.

The mobile devices 102 may provide the prepayment instructions to theone or more electronic payment systems 110. For example, the mobiledevices 102 may use a 3G cellular connection to provide the prepaymentinstructions for an amount of $1 for supply outlet 140B to the one ormore electronic payment systems 110 through the Internet.

In some implementations, the mobile devices 102 receive confirmations.For example, a mobile device 102 may receive a confirmation that asupply outlet 140B has been credited for the prepayment. Theconfirmation indicates an amount of resource credited for the prepaymentand a total remaining amount of resource prepaid for the supply outlet140B, and display the confirmation to users. The total remaining amountof resource prepaid for the supply outlet 140B may be different than theamount of resource credited for a particular prepayment because theamount of resource credited for a particular prepayment may be added toa remaining amount of resource already prepaid for the supply outlet140B from a previous prepayment. In some implementations, the mobiledevices 102 enable users to view prepayment and usage information forsupply outlets. For example, a user may use a mobile device to request ahistory of prepayments for a particular supply outlet, a history ofamounts and dates that resources were provided through the particularsupply outlet, an amount of a resource remaining prepaid for the supplyoutlet, or some other information.

The one or more electronic payment systems 110 may process prepaymentinstructions. For example, the one or more electronic payment systems110 may receive a prepayment instruction of $1 from a particular mobiledevice of a particular user, determine a payment source for theprepayment instruction, e.g., determine a credit card account, bankaccount, virtual wallet, mobile money account, or some other paymentsource, charge $1 to the payment source, and determine that the chargeis successfully completed. Example electronic payment systems 110 mayinclude PayPal, Venmo, or other non-physical-cash based payment systems.In some implementations, the electronic payments systems 110 and thecentral server 120 may be controlled by the same entity or by differententities, e.g., companies.

After processing a prepayment instruction, the one or more electronicpayment systems 110 may provide prepayment information to the centralserver 120. For example, the one or more electronic payment systems 110may provide prepayment information that indicates a prepayment of $1 forsupply outlet 140B to the central server 120 over the Internet, e.g.,through an application program interface (API) call in the form of aHTTPS request including parameters indicating the prepaymentinformation.

The central server 120 may process prepayment information to creditaccounts associated with the supply outlets 140. The central server 120may be one or more computers. For example, the central server 120 may bea cloud computing platform including multiple servers or a singleserver. The central server 120 may receive the prepayment informationfrom the one or more electronic payment systems 110, receive requestsfrom the intermediate gateways 130 for prepayment orders, and inresponse to the requests, provide prepayment orders to the intermediategateways 130 for the intermediate gateways 130 to provide to theappropriate supply outlets 140. An example interaction is furtherdescribed below in FIGS. 2A and 2B. The central server 120 may alsoreceive, from the intermediate gateways 130, information describingresources delivered by the supply outlets 140, and provide reports tothe mobile devices 102 indicating a history of orders and usage. Thecentral server 120 may include an API through which prepaymentinformation may be received from the one or more electronic paymentsystems 110. In some implementations, the central server 120 may provideassist users of mobile devices 102 to make prepayments. For example, thecentral server 120 may suggest an amount of resource to prepay for asupply outlet based on determining a typical weekly usage amount for thesupply outlet, and a corresponding monetary value for the amount of theresource.

The intermediate gateways 130 may be one or more computers that receiveprepayment orders from the central server 120 and provide the prepaymentorders to the supply outlets 140. For example, the intermediate gateway130A may receive a prepayment order for the supply outlet 140B and, inresponse to a request from the supply outlet 140B for prepayment ordersfor the supply outlet 140B, provide the prepayment order to the supplyoutlet 140B. An example interaction is further described below in thedescription related to FIG. 2B. The intermediate gateways 130 may alsoreceive, from the supply outlets 140, information describing amounts ofresources delivered by the supply outlets 140 and provide theinformation to the central server 120.

The supply outlets 140 may be one or more devices that regulate anamount of the resources 101 that are provided. The supply outlets 140may regulate the amount of the resources 101 that are provided by, foreach supply outlet, limiting an amount of the resource 101 that may beprovided from the supply outlet to the amount of the resource 101 forwhich prepayment has been received. For example, the supply outlet 140Bmay monitor an amount of resource provided by the supply outlet 140B andan amount of resources prepaid for the supply outlet 140B, and when theamount of resources provided by the supply outlet 140B reaches theamount of resources prepaid for the supply outlet 140B, preventadditional amounts of the resource from being provided by the supplyoutlet 140B. An example of a supply outlet in the form of water meterthat controls whether water may be delivered through a faucet is furtherdescribed below in FIG. 3.

Different configurations of the system 100 may be used wherefunctionality of any combination of two or more of the mobile devices102, the one or more electronic payment systems 110, the central server120, the intermediate gateways 130, and the supply outlets 140 may becombined, further separated, distributed, or interchanged. For example,the one or more electronic payment system 110 and the central server 120may be combined in a single system.

FIGS. 2A and 2B are interaction diagrams 200, 240 of exampleinteractions for delivering resources. The following describes theinteraction as being performed by components of the system 100 that aredescribed with reference to FIG. 1. However, the interaction may beperformed by other systems or system configurations or othercombinations of the components. Additionally, while interactions aredescribed as being performed by the mobile device 102A, the gateway130A, and the supply outlet 140B, similar interactions may be performedby other mobile devices of the mobile devices 102, other gateways of thegateways 130, or other supply outlets of the supply outlets 140.

Initially, the mobile device 102A may provide a prepayment instructionfor a supply outlet to the electronic payment system 110 (202). Forexample, the mobile device 102A may provide a prepayment instruction fora payment of $1 in response to input from a user indicating an amount of$1 be credited to a unique identifier associated with an accountassociated with the supply outlet 140B. In another example, the mobiledevice 102A may provide prepayment instruction for payment of $1 withoutspecifying an account for the central server 120 to credit, and asdescribed below, the central server 120 may determine an account of asupply outlet to credit by default for the mobile device 102A.

The electronic payment system 110 may receive the prepayment instructionand, in response, process the prepayment instruction (204). For example,the electronic payment system 110 may receive the prepayment instructionof $1 from the mobile device 102A and charge $1 to a payment sourceassociated with the mobile device 102A or with the user or otherwiseindicated by the prepayment instruction.

The electronic payment system 110 may provide prepayment information tothe central server 120 (206). For example, in response to successfullycharging $1 in response to a prepayment instruction indicating $1, theelectronic payment system 110 may access an API of the central serverand include parameters indicating a phone number, e.g., (999) 999-9999of the mobile device 102 that provided the prepayment, the amount paid,e.g., $1, a timestamp for the prepayment, e.g., 1/1/2015 11:11:11 AM,and an indication of the supply outlet to credit, e.g., the uniqueidentifier for the account associated with the supply outlet 140B.

The central server 120 may receive the prepayment information and, inresponse, determine an amount of the resource to credit to a supplyoutlet (208). For example, the central server 120 may credit onethousand gallons of water to the supply outlet 140B. The central server120 may determine the amount of resource to credit to the supply outletbased on translating the monetary value of the prepayment amount to acorresponding amount of resource. For example, the central server 120may determine to credit the supply outlet 140B based on determining thata thousand gallons of water is $1, and in response, determine to creditthe supply outlet 140B one thousand gallons of water for the prepaymentof $1. In another example, the central server 120 may determine tocredit the supply outlet 140B based on determining that a thousandgallons of water is $2, and in response, determine to credit the supplyoutlet 140B 500 gallons of water for the prepayment of $1. The centralserver 120 may additionally or alternatively determine the amount ofresource to credit to the supply outlet based on a pricing function thatcalculates an amount of resource for a monetary amount.

The central server 120 may generate an order for the supply outlet thatindicates the amount of resource to credit to the supply outlet (210).For example, after determining to credit one thousand gallons of waterto the supply outlet 140B, the central server may generate an orderindicating that the supply outlet 140B be credited one thousand gallonsand queue the order in an order queue.

In generating the orders, the central server 120 may use informationthat stores, one or more of, associations between (i) users and useraccounts associated with the users, (ii) unique identifiers for accountsfor supply outlets and unique identifiers for supply outlets associatedwith the accounts for the supply outlets, (iii) sets of supply outlets140 and corresponding gateways associated with each set, and (iv)gateways 130 and the central server 120 associated with the gateways130. The associations may be permanent or may be modified. For example,a particular supply outlet may be associated with one gateway but ifanother gateway is established closer to the particular supply outletwith a more reliable connection, the other gateway may be associatedwith the central server 120 and the particular supply outlet may bere-associated with the other gateway that is established closer. Inanother example, if a supply outlet moves closer to another gateway, thesupply outlet may be re-associated with the other gateway.

Each of the orders generated by the central server 120 may indicateunique identifiers for the supply outlet to receive the order. Forexample, an order for the supply outlet 140B may include a uniqueidentifier for the supply outlet 140B. The unique identifier for thesupply outlet may be used to route the order to the supply outlet, asdescribed in FIG. 2B. In some implementations, the unique identifierassociated with the supply outlet may be the unique identifierassociated with the unique account associated with the supply outlet.For example, where the prepayment instruction and prepayment informationindicate an account associated with a supply outlet to credit, thecentral server 120 may determine a unique identifier for the supplyoutlet associated with the account, and in response, determine toprovide a prepayment order to the supply outlet with the uniqueidentifier determined to be associated with the account.

The central server 120 may store user accounts that may each be anaccount that is associated with a user where the account specifies oneor more of a default account of a supply outlet to credit, accounts ofsupply outlets for which the user is authorized to view information,payment sources associated with the user, and one or more phone numbersassociated with the user. For example, a user account for a particularuser may specify for the default account to credit the unique identifierfor the account associated with the supply outlet 140B, a PayPal accountname associated with the user, and a phone number of (999) 999-9999associated with the user. Where the prepayment instruction andprepayment information received by the central server 120 do notindicate a supply outlet or an account to credit, the central server 120may determine a particular user account associated with the phone number(999) 999-9999 indicated by the prepayment information, a defaultaccount associated with the supply outlet 140B for the particular useraccount, and credit the account for the supply outlet 140B because it isthe default account.

The associations may include mappings that indicate which supply outlets140 are associated with which gateway 130. For example, a mapping mayindicate that the supply outlet 140A and the supply outlet 140B are bothassociated with the gateway 130A. The central server 120 may include inthe order an identifier for a gateway to receive the order to forward toa supply outlet based on the mappings. The unique identifier for thegateway may be used to route the order to the supply outlet, asdescribed in FIG. 2B. The central server 120 may determine theidentifier for the gateway to include in the order based on theassociations. For example, the central server 120 may determine ordersfor the gateway 130A based on receiving prepayment information for thesupply outlet 140A, determining that the supply outlet 140A is mapped tothe gateway 130A, and in response, generating the order to indicate thegateway 130A should receive the order.

The central server 120 may additionally or alternatively include in eachof the orders a unique identifier for the order that distinguishes theorder from other orders. The unique identifier for the order may be usedto ensure that an order is received by a supply outlet and is notcredited more than once, as described in FIG. 2B.

In some implementations, after generating the order, the central server120 may provide a confirmation to a user who made the prepayment. Forexample, the central server 120 may transmit a SMS text message to thephone number that provided the prepayment indicating that the account orsupply outlet will be credited shortly.

FIG. 2B illustrates how, in some implementations, the central server 120may not proactively provide the gateways 130 orders and the gateways maynot proactively provide the supply outlets 140 orders received from thecentral server 120. Instead, the central server 120 may providegenerated orders to the gateways 130 in response to requests for ordersfrom the gateways 130, and the gateways 130 may provide the supplyoutlets 140 orders in response to requests from the supply outlets 140for orders. In some implementations, combinations of the approachdescribed earlier in this approach for generating and requesting ordersmay be used.

In more detail, the gateway 130A may request orders for supply outletsassociated with the gateway 130A from the central server 120 (212). Forexample, the gateway 130A may request orders for the gateway 130A over a2G/3G wireless Internet connection that incurs a cellular networkcharge, where the request is for all orders for the gateway 130A notalready received by the gateway 130A. The gateways 130A may requestorders at regular intervals. For example, the supply outlets may providerequests every thirty seconds, minute, five minute, or some otherinterval. The gateways 130 may request orders from the central server120 as 3G internet connections may be rarely remotely accessible. Therequest for orders may include a unique identifier for the gatewayindicating that the request is from the gateway.

The central server 120 may obtain the request for orders for the gateway130A, and in response, determine orders for the gateway 130A (214). Forexample, the central server 120 may determine an order of one thousandgallons of water for supply outlet 140B and an order of one thousandgallons of water for supply outlet 140A are for the gateway. The centralserver 120 may determine orders for a gateway based on mappingsindicating which supply outlets 140 are associated with which gateway130. For example, the central server 120 may determine orders for thegateway 130A based on, in response to a request indicating the requestis from gateway 130A, determining that both the supply outlet 140A andthe supply outlet 140B are mapped to the gateway 130A and in response,determining that orders for the supply outlet 140A and the supply outlet140B are for the gateway 130A. In another example, the central server120 may determine orders for the gateway 130A based on orders thatalready indicate which gateway is associated with the order, andidentifying the orders that indicate that the order is for gateway 130A.

The central server 120 may provide the orders for the gateway 130A tothe gateway 130A (216). For example, the central server 120 may providethe gateway 130A an order of one thousand gallons of water for thesupply outlet 140B, an order of two thousand gallons of water for thesupply outlet 140B, and an order of one thousand gallon of water for thesupply outlet 140A. In providing the orders for a gateway, the centralserver 120 may continue providing an order for a gateway until thecentral server 120 receives a confirmation from the gateway indicatingthat the gateway has received the order. For example, if the centralserver 120 does not receive a confirmation that the gateway 130Areceived the order of one thousand gallons of water for supply outlet140B, the order of two thousand gallons of water for the supply outlet140B, or the order of one thousand gallons of water for supply outlet140A, the central server 120 may provide the orders to the gateway 130Aagain the next time the gateway 130A requests orders for the gateway. Byproviding orders until a confirmation is received, the central server120 may ensure orders are received by the gateway 130A even when aconnection with the gateway 130A is unreliable.

The confirmations from the gateway 130A may indicate unique identifiersfor the orders that were received by the gateway 130A. Accordingly, thecentral server 120 may determine which orders were not received by thegateway 130A based on a lack of confirmation including the uniqueidentifier for those orders, and provide again those orders for which noconfirmation was received. By avoiding sending orders for whichconfirmation has already been received, the system 100 may avoidredundant processing or accidentally crediting an order multiple times.

The gateway 130A may receive the orders and queue the orders forproviding to the supply outlets 140 (218). For example, the gateway 130Amay receive an order of one thousand gallons of water for the supplyoutlet 140B, an order of two thousand gallons of water for the supplyoutlet 140B, and an order of one thousand gallons of water for thesupply outlet 140A, and queue to provide the order of one thousandgallons of water and the order of two thousand gallons of water for thesupply outlet 140B to the supply outlet 140B once the supply outlet 140Brequests orders for the supply outlet 140B, and queue to provide theorder of one thousand gallons of water for the supply outlet 140A tosupply outlet 140A once the supply outlet 140A requests orders for thesupply outlet 140A.

As discussed above, the gateway 130A may also provide confirmations tothe central server 120 that orders from the central server 120 werereceived by the gateway 130A. The gateway 130A may also ensure that aparticular order is not queued to be provided to the supply outlets 140multiple times. For example, in the case where the gateway 130A provideda confirmation that a particular order was received to the centralserver 120 but the central server 120 did not receive the confirmationdue to an unreliable connection, the gateway 130A may receive aduplicate order from the central server 120 with a particular uniqueidentifier, determine that an order with the same unique identifier isor was already queued to be provided to a supply outlet, and inresponse, determine to discard the duplicate order and send anotherconfirmation to the central server 120 that the order was received bythe gateway 130A.

The supply outlet 140B may request orders for the supply outlet 140B(220). For example, the supply outlet 140B may provide a request to thegateway 130A over a wireless connection that does not incur a cellularnetwork charge, where the request is for all orders for the supplyoutlet 140B that have not yet been received by the supply outlet 140B. Arequest from a supply outlet may include a unique identifier of thesupply outlet that indicates that the request is from the supply outlet.

The supply outlets may provide requests at regular intervals. Forexample, the supply outlets may provide requests every thirty seconds,minute, five minute, or some other interval. By receiving orders inresponse to requests, the supply outlets may conserve power as thesupply outlets may only need to listen for orders from the gateways forpredetermined time lengths, e.g., one second, five seconds, fifteenseconds, or some other time length, after providing the request.

In response to receiving a request for orders for a supply outlet, thegateway 130A may determine orders for the supply outlet (222). Forexample, the gateway 130A may receive a request from the supply outlet140B for orders for the supply outlet 140B, and in response, determinean order of one thousand gallons of water and an order of two thousandgallons of water is for the supply outlet 140B. In another example, thegateway 130A may receive a request from the supply outlet 140A fororders for the supply outlet 140A, and in response, determine an orderof one thousand gallons of water is for the supply outlet 140A. Thegateway 130A may determine orders for a supply outlet based ondetermining a unique identifier of a supply outlet in the request, anddetermine orders that indicate that the order is for the uniqueidentifier of the supply outlet that provided the request.

The gateway 130A may provide the orders for the supply outlet 140B tothe supply outlet 140B (224). For example, the gateway 130A maydetermine an order of one thousand gallons of water and an order of twothousand gallons of water is for the supply outlet 140B, and inresponse, provide the order of one thousand gallons of water and theorder of two thousand gallons of water to the supply outlet 140B.

In providing the orders for supply outlets 140, the gateway 130A maycontinue providing an order until the gateway 130A receives aconfirmation from the supply outlets 140 indicating that the relevantsupply outlet has received the order. For example, if the gateway 130Adoes not receive a confirmation that the supply outlet 140B received theorders provided to the supply outlet 140B, the gateway 130A may againprovide the orders to the supply outlet 140B the next time the supplyoutlet 140B requests orders for the supply outlet 140B. Similarly to asdiscussed for the central server 120, the gateway 130A may determine toprovide an order with a unique identifier again based on determiningthat a confirmation, that indicates that an order with the uniqueidentifier was received by the supply outlet, was not received from thesupply outlet.

The supply outlet 140B may receive the orders and increment an amount ofresource available from the supply outlet 140B based on the ordersreceived by the supply outlet 140B (226). For example, the supply outlet140B may already store that four thousand gallons of water are prepaidfor the supply outlet 140B, receive orders of one thousand gallons andtwo thousand gallons prepaid for the supply outlet 140B, and incrementthe amount of water prepaid for the supply outlet 140B from fourthousand gallons to seven thousand gallons.

The supply outlet 140B may also ensure that a particular order is notcredited multiple times. For example, in the case where the supplyoutlet 140B provided a confirmation that a particular order was receivedto the gateway 130A but the gateway 130A did not receive theconfirmation due to an unreliable connection, the supply outlet 140B mayreceive a duplicate order from the gateway 130A with a particular uniqueidentifier, determine that an order with the same unique identifieralready caused the supply outlet 140B to increment an amount of resourceavailable, and in response, determine to discard the duplicate order andsend another confirmation to the gateway 130A that the order wasreceived by the supply outlet 140B.

In some implementations, the supply outlet 140B may also provideresource usage information to the gateway 130A to provide to the centralserver 120. For example, the supply outlet 140B may provide, to thegateway 130A, information indicating one hundred gallons of water havebeen provided by the supply outlet 140B, and the gateway 130A may thenprovide, to the central server 120, information indicating that thesupply outlet 140B has provided one hundred gallons of water.

The supply outlet 140B may provide the information indicating resourceusage information when the supply outlet 140B requests orders for thesupply outlet 140B. For example, each time the supply outlet 140Brequests orders for the supply outlet 140B, the supply outlet 140B mayalso include information indicating a total amount of water provided bythe supply outlet 140B. The gateway 130A may receive the informationindicating a total amount of water provided by the supply outlet 140Band receive information from other supply outlets, add a timestamp tothe information indicating when the information was received from thesupply outlet 140B, and queue to provide the information the next timethe gateway 130A requests orders for the gateway 130A. The centralserver 120 may receive the information indicating total amounts of waterprovided by supply outlets and based on increases in total amounts for asupply outlet, determine an amount of water provided by the supplyoutlet. For example, the central server 120 may receive informationindicating that a total of one hundred gallons of water were provided bythe supply outlet 140B at 2 PM and determine that the central server 120previously received information indicating that a total of ninety fivegallons of water were provided by the supply outlet 140B at 1:45 PM, andin response, determine that five gallons of water were provided by thesupply outlet 140B between 1:45 PM and 2 PM. The central server 120 maystore the usage history to provide usage history to users and orderhistory to users.

In some implementations, the central server 120 may alternatively oradditionally provide commands to the supply outlets 140 through asimilar process as providing orders. The central server 120 may receivea command from the mobile device 102A of a user to prevent resourcesfrom being provided by the supply outlet 140B for a particular timerange. For example, the central server 120 may receive instructions fromthe mobile device 102A of a user to prevent water from being deliveredby the supply outlet 140B between 1 AM to 8 AM when the user will not betrying to obtain water from the supply outlet 140B and is concerned thatothers may want to obtain water from the supply outlet 140B without theuser's consent. The central server 120 may determine to provide acommand to the gateway 130A based on the instructions. For example, thecentral server 120 may determine that it is now 1 AM and based on theinstructions to prevent water from being delivered by the supply outlet140B between 1 AM to 8 AM, determine to queue a command to the gateway130A to provide the supply outlet 140B, where the command is to preventresources from being delivered. The central server 120 may then providethe command in response to a request from the gateway 130A for orders.The gateway 130A may then provide the command to the supply outlet 140Bin response to a request from the supply outlet 140B for orders for thesupply outlet 140B. In response to receiving the command, the supplyoutlet 140B may then prevent resources from being delivered from thesupply outlet 140B. The central server 120 may then determine at 8 AM tosend a command to the gateway 130A to provide the supply outlet 140B,where the command is to enable resources to be delivered.

FIG. 3 is a block diagram of an example water meter 300 for deliveringwater. The water meter 300 may be an example implementation of thesupply outlet 140 where the resource provided is water. Briefly, and asdescribed in further detail below, the water meter 300 may include aflow meter 304, a valve 306, a H-Bridge 308, a radio 310, a battery 312,a voltage regulator 314, and a microcontroller 316. In someimplementations, different configurations of the water meter 300 may beused. For example, the water meter 300 may not include the voltageregulator 314 or the flow meter 304 and valve 306 may be interchanged inorder relative to the flow of water through the water pipe 302.

The flow meter 304 may measure an amount of water that flows through awater pipe 302 that receives water from a water supply network 340 anddelivers water through a faucet 350. For example, the flow meter 304 maymeasure that one gallon of water from the water supply network 340 hasflowed through the water pipe 302 and through the faucet 350. The amountof water that flows through the water pipe 302 may correspond to theamount of water that is delivered to a home through the faucet 350. Forexample, if one gallon of water flows through the water pipe 302, onegallon of water may be considered to have been delivered to a home.

In some implementations, the flow meter 304 may be a “paddle wheel”attached to a ring magnet diametrically magnetized, which rotatesaccording to the flow of water passing through it. As the ring magnetrotates, the magnet may induce an alternating magnetic field, which maybe sensed by a latching hall sensor located next to the wheel. Thelatching hall sensor may generate a square electric signal that is readby the microcontroller 316. In some implementations, other flow meters304 that measure a flow of water may be used instead. For example, themagnet may be attached to a paddle of the “paddle wheel.”

The valve 306 may control a flow of water through the water pipe 302.For example, the valve 306 may close to stop water from flowing throughthe water pipe 302 or may open to allow water to flow through the waterpipe 302. The valve 306 may control the flow of water based on inputfrom the H-Bridge 308. In some implementations, the valve 306 may be alatching solenoid valve, which can be opened or closed by a positive ornegative electric pulse of a minimal duration, e.g., 20 ms, 30 ms, 50ms, or some other duration. The latching aspect of the valve may meanthe valve keeps an open/close status without consuming any power. Thedesign of the valve used may mean backflow of water through the valve isvery difficult, if not impossible.

The H-Bridge 308 may be a valve controlling circuit that allows themicrocontroller 316 to provide enough current to the valve 306 tooperate the valve 306. For example, the H-Bridge 308 may receive aninstruction from the microcontroller 316 to open the valve 306, and inresponse, may generate a positive electric pulse of a minimal durationto open the valve 306.

The radio 310 may be a transceiver that enables communication betweenthe water meter 300 and a gateway 360 over a wireless connection 362that is not subject to cellular network charges. For example, the radiomay be a sub GHz radio module. While any sub GHz frequency may beusable, the 434 MHz part of the ISM band may be used as it requires noradio license from authorities in many countries. The radio module maybe attached to a quarter wavelength monopole antenna 311 and useGaussian frequency-shift keying (GFSK) modulation to transmit data.Gateway 360 may be similar to gateways 130.

The battery 312 may be a power source that provides power to the watermeter 300. For example, the battery 312 may be a set of four AA alkalinebatteries that allows the water meter 300 to operate with no physicalconnection to any system besides the water pipe 302. In another example,the battery 312 may be two C alkaline batteries, a 9V battery, one ormore camera batteries, or some other type of battery. The battery 312may provide power to the H-Bridge 308. The voltage regulator 314 mayreceive power from the battery 312 and provide a stable voltage level tothe microcontroller 316 and the radio 310.

The microcontroller 316 may control the water meter 300 based oncommunications with a gateway through the radio 310, monitoring flowreadings from the flow meter 304, and instructing the H-Bridge 308 tocontrol the valve 306. Generally, the microcontroller 316 may controlthe water meter 300 based on storing a maximum amount of water that maybe provided by the water meter 300 that corresponds to the cumulativeamount of water that orders from the gateway indicate have been prepaid,measuring the flow of water based on the flow meter 304, and keeping thevalve 306 open while the amount of water that has flowed through theflow meter 304 is less than the maximum amount of water that may beprovided by the water meter 300.

In some implementations, the microcontroller 316 may measure flow basedon square electric signals from the flow meter 304. The flow meter 304may emit a square electric signal, for which each “rising” edge (pulse)triggers an interrupt in the microcontroller 316. The microcontroller316 may calculate a volume of water at each interrupt based onincrementing the volume between the last two pulses based on a functionwith an input of time elapsed between the pulses, where the function isnon-linear and established through calibration of the device. All valuesmay be counted using units small enough, e.g., microliters andmicroseconds, to allow integer-only calculations as integer calculationsmay be much faster than floating point calculations on microcontroller316 without floating point units, which may eventually save power as themicrocontroller 316 may remain active for shorter periods of time. Thefunction may allow compensation for variations in the ratioflowrate/wheel rotation speed across a range of flowrates, e.g.,flowrates covered by ISO 4064 or OIML R49. The calculated volumeincrements may be summed up into a periodic value (PV). The time elapsedbetween pulses may be several seconds, and the PV may be stored inmicroliters. At each interrupt from the flow meter 304, the volumeincrement may be added to PV.

A totalizing index may be maintained in the meter 304 in “meter readingunits” which may equal 32,768 (or 2{circumflex over ( )}15) microliterseach, a value which may allow fast binary computation and a wide rangeof values when stored as a 32 bit unsigned integer, e.g., up to2{circumflex over ( )}32*32.768 ml or 140,737 m3 with a resolution of 32ml, where usual meters can store values up to 99,999 m3 with a typicalresolution of 50 ml. The totalizing index may correspond to total amountof water delivered by the water meter 300. At every period end, themicrocontroller 316 may perform the following calculation: indexincrement=PV/32768 (rounded to the nearest inferior integer),index=previous index+index increment, and PV is set to PV—indexincrement. The calculation may be integer-only and allow transfer of allvolumes counted without losses. A persistent memory (EEPROM) of themicrocontroller 316 may be updated periodically with the total index soas not to lose data should a microcontroller 316 restart occur, expectedor not.

In some implementations, the water meter 300 may manage energyconsumption of the water meter 300. The water meter 300 may manageenergy consumption based on turning off or depowering components of thewater meter 300 when not needed. As fairly accurate timings to measureflow may be needed and the microcontroller 316 may be able to only tracktime accurately in shallow sleep modes, the following process may beused. If no flow has been sensed, e.g., no interrupts received from theflow meter 304 for more than X milliseconds (e.g., five thousandmilliseconds) consider that water is not flowing, e.g.,water_is_flowing=False, and go to deep sleep for a duration ofSLEEP_TIME seconds (e.g., 10 seconds or some other length of time). Ifthe end of the sleep period is reached without sensing any interrupt,deep sleep for another period. If deep sleep is interrupted by a pulsefrom flow meter 304, set water_is_flowing to True, switch to shallowsleep mode where time can be measured accurately for a short period oftime, e.g., sixteen ms or some other length of time. If shallow sleepperiod elapses without interrupts, shallow sleep for a period of doublethe previous duration, until duration reaches a threshold, e.g., fiveseconds, beyond which it is safe to consider that water flow has stopped(then set water_is_flowing to False). Switch to deep sleep in this caseand revert back to beginning of the process. If shallow sleep isinterrupted by a pulse, go back to shallow sleep for a minimal period oftime, e.g., sixteen ms or some other duration.

In some implementations, all transmissions may be initiated by the watermeter 300 and directed at a gateway. This may allow the microcontroller316 of the water meter 300 to spend more time in deep sleep modes withthe radio 310 turned off, hence saving power. To extend range, data maybe transmitted at low bitrates, e.g., 1200 to 5000 bits/second, whichmay allow higher sensitivity on the receiving side. In someimplementations, only very small data packets may be sent, which maycontain a network identifier coded on 8 bit integer, a sender identifiercoded on 8 to 16 bit integer, a recipient identifier coded on 8 to 16bits bit integer, and a message type character coded on 8 bits, followedby a series of arguments whose length depends on the message type, e.g.,an “r” message is followed by 4 bytes, whose meaning is known to bothsender and recipient code, e.g., a 32 bit unsigned integer representingthe meter index in “meter reading units” described above. A node in thenetwork may be uniquely identified by a pair (node identifier|networkidentifier).

In some implementations, a data transmission sequence may be as follows,always initiated by the meter side: Meter reports index to gateway withan ‘r’ message, gateway acknowledges reception to the meter 300, andgateway follows up by sending an order message, whose exact type dependson what has been requested from the central server. Examples of ordersinclude “T” (topup), “C” (close valve), “O” (open valve), “X” (noorder), and others. Similar to messages, orders may be followed by aknown format of arguments. The water meter 300 may acknowledge eachorder by an agreed message, e.g.: a “b” (balance) message indicating acurrent maximum remaining amount of water that can be provided inresponse to a “T” order. An “X” order may close a dialog, at which pointthe water meter 300 may return to sleep and a gateway is free toexchange with another meter.

In some implementations, all transmissions can be attempted a number oftimes until acknowledgement is received, a timeout occurs or the maximumnumber of attempts, e.g., three, four, five, or some other number, isreached. If the transmission fails, the meter may store the informationfor later and go back to sleep. All radio transmissions may be encryptedusing AES-256 or any other encryption algorithm.

FIG. 4 is a block diagram of an example intermediate gateway 400. Thegateway 400 may include a 2G or 3G transceiver 402, a radio 404 andcorresponding microcontroller 406, a power supply 408, and computer 410.In some implementations, different configurations of the intermediategateway 400 may be used. For example, the intermediate gateway 400 mayinclude multiple 2G or 3G transceivers 402 to deal with an unreliablenetwork. The 2G/3G transceiver 402 may enable the gateway 400 tocommunicate with a central server 440 over a wireless connection 432that incurs a cellular network charge. The central server 440 may besimilar to central server 120. The radio 404 and correspondingmicrocontroller 406 may enable the gateway 400 to communicate withsupply outlets 450 over a wireless connection 452, e.g., a wirelessconnection different than that for connecting to a central server 440that does not incur a cellular network charge. The supply outlets 450may be similar to the supply outlets 140 and the central server 440 maybe similar to the central server 120. The power supply 408 may providepower to the gateway 400. For example, the power supply 408 may be asolar panel with batteries and charge management controller sized toprovide uninterrupted power to the computer 410, day and night.

The computer 410 may be a device that manages communications between thecentral server 440 and supply outlets to transfer data between thesupply outlets and central server, including when a 2G or 3G network isnot available, in which case the computer 410 may store information forlater dispatch. The computer 410 may use a persistence layer, e.g., aSQLite database, which allows storage and retrieval of structured datathrough querying, a serial link thread to communicate with the supplyoutlets, and a cloud link thread to communicate with the central server.

The serial link thread operating on the computer 410 may listen to themicrocontroller 406 and the radio 404 through a serial port. The seriallink thread may receive messages from the supply outlets as describedabove and store them in the persistence layer with a timestamp. Inresponse to messages, the serial link thread may query the persistencelayer for orders to send back to the supply outlet that just sent amessage.

The cloud link thread may connect to the central server periodically toupload messages stored in the database. Upon successful upload of amessage, a message may be removed from the persistence layer to avoidmultiple uploads. Messages may be aggregated before uploading to limitprotocol overhead. The list of messages may be packed into a JSON datastructure such as [{message_identifier: 1, message_content: { . . . }},. . . ]. Upon upload, the central server may send back a successmessage, or a list of identifiers that could not be saved. The cloudlink may download, from the central server, new orders to be dispatchedto supply outlets connected to this gateway. Orders received may bestored in the persistence layer for retrieval by the serial link thread.To obtain relevant orders, the gateway may send a unique identifier forthe gateway. The central server may find orders for supply outlets thatare linked to the gateway in the database, e.g., based on the uniqueidentifier for the gateway. Similarly to messages, orders may bereceived by the gateway 400 in a single JSON data structure, which mayallow efficient use of expensive bandwidth between the gateway 400 and acentral server. The gateway 400 may confirm order execution to thecentral server, simply uploading a list of identifiers for orders andtimestamps indicating when each order was processed by a supply outlet.Again, data may be packed in a JSON structure for efficiency reasons.

The persistence layer may be structured as follows. A message table withthe following fields, a timestamp for the date/time at which the messagewas received from the supply outlet, the node and network identifier ofthe supply outlet, and the type of message received and its arguments,e.g., an index of the meter. An order table with the following fields, aunique order identifier obtained from the central server (forconfirmation of order execution to the server), the node and networkidentifier of the supply outlet targeted by the order, the order type,the order arguments e.g., volume for topup orders, a “processed at”timestamp field, initially empty when the gateway receives the orderfrom the central server, and set to local time upon receiving orderexecution confirmation from the supply outlet.

In some implementations, the resources delivered by a system may includedelivering resources other than water. For example, the system 100 mayprovide for prepayment for use of items, e.g., trash cans, bicycles,ironing boards, street lights, where the items have meters that monitorand control their usage, and communicate over a wireless connection thatdoes not incur a cellular network charge with a gateway, like describedabove, that in turn communicates with a central server, like describedabove, over a wireless connection that does incur a cellular networkcharge.

Embodiments of the subject matter, the functional operations and theprocesses described in this specification can be implemented in digitalelectronic circuitry, in tangibly-embodied computer software orfirmware, in computer hardware, including the structures disclosed inthis specification and their structural equivalents, or in combinationsof one or more of them. Embodiments of the subject matter described inthis specification can be implemented as one or more computer programs,i.e., one or more modules of computer program instructions encoded on atangible nonvolatile program carrier for execution by, or to control theoperation of, data processing apparatus. Alternatively or in addition,the program instructions can be encoded on an artificially generatedpropagated signal, e.g., a machine-generated electrical, optical, orelectromagnetic signal that is generated to encode information fortransmission to suitable receiver apparatus for execution by a dataprocessing apparatus. The computer storage medium can be amachine-readable storage device, a machine-readable storage substrate, arandom or serial access memory device, or a combination of one or moreof them.

The term “data processing apparatus” encompasses all kinds of apparatus,devices, and machines for processing data, including by way of example aprogrammable processor, a microcontroller, a computer, or multipleprocessors or computers. The apparatus can include special purpose logiccircuitry, e.g., an FPGA (field programmable gate array) or an ASIC(application specific integrated circuit). The apparatus can alsoinclude, in addition to hardware, code that creates an executionenvironment for the computer program in question, e.g., code thatconstitutes processor firmware, a protocol stack, a database managementsystem, an operating system, or a combination of one or more of them.

A computer program (which may also be referred to or described as aprogram, software, a software application, a module, a software module,a script, a thread, or code) can be written in any form of programminglanguage, including compiled or interpreted languages, or declarative orprocedural languages, and it can be deployed in any form, including as astandalone program or as a module, component, subroutine, or other unitsuitable for use in a computing environment. A computer program may, butneed not, correspond to a file in a file system. A program can be storedin a portion of a file that holds other programs or data (e.g., one ormore scripts stored in a markup language document), in a single filededicated to the program in question, or in multiple coordinated files(e.g., files that store one or more modules, sub programs, or portionsof code). A computer program can be deployed to be executed on onecomputer or on multiple computers that are located at one site ordistributed across multiple sites and interconnected by a communicationnetwork.

The processes and logic flows described in this specification can beperformed by one or more programmable computers executing one or morecomputer programs to perform functions by operating on input data,generating output, or generating side effects. The processes and logicflows can also be performed by, and apparatus can also be implementedas, special purpose logic circuitry, e.g., an FPGA (field programmablegate array) or an ASIC (application specific integrated circuit).

Computers suitable for the execution of a computer program may include,by way of example, computers based on general or special purposemicroprocessors or both, or any other kind of central processing unit.Generally, a central processing unit will receive instructions and datafrom a read-only memory or a random access memory or both. The essentialelements of a computer are a central processing unit for performing orexecuting instructions and one or more memory devices for storinginstructions and data. Generally, a computer will also include, or beoperatively coupled to receive data from or transfer data to, or both,one or more mass storage devices for storing data, e.g., magnetic,magneto optical disks, or optical disks. However, a computer need nothave such devices. Moreover, a computer can be embedded in anotherdevice, e.g., a mobile telephone, a personal digital assistant (PDA), amobile audio or video player, a game console, a Global PositioningSystem (GPS) receiver, or a portable storage device (e.g., a universalserial bus (USB) flash drive), to name just a few.

Computer readable media suitable for storing computer programinstructions and data include all forms of nonvolatile memory, media andmemory devices, including by way of example semiconductor memorydevices, e.g., EPROM, EEPROM, and flash memory devices; magnetic disks,e.g., internal hard disks or removable disks; magneto optical disks; andCD-ROM and DVD-ROM disks. The processor and the memory can besupplemented by, or incorporated in, special purpose logic circuitry.

To provide for interaction with a user, embodiments of the subjectmatter described in this specification can be implemented on a computerhaving a display device, e.g., a CRT (cathode ray tube), or LCD (liquidcrystal display) monitor, or organic light-emitting diode (OLED)display, for displaying information to the user and a keyboard and apointing device, e.g., a mouse or a trackball, by which the user canprovide input to the computer. Other kinds of devices can be used toprovide for interaction with a user as well; for example, feedbackprovided to the user can be any form of sensory feedback, e.g., visualfeedback, auditory feedback, or tactile feedback; and input from theuser can be received in any form, including acoustic, speech, or tactileinput. In addition, a computer can interact with a user by sendingdocuments to and receiving documents from a device that is used by theuser; for example, by sending web pages to a web browser on a user'sclient device in response to requests received from the web browser.

Embodiments of the subject matter described in this specification can beimplemented in a computing system that includes a back end component,e.g., as a data server, or that includes a middleware component, e.g.,an application server, or that includes a front end component, e.g., aclient computer having a graphical user interface or a Web browserthrough which a user can interact with an implementation of the subjectmatter described in this specification, or any combination of one ormore such back end, middleware, or front end components. The componentsof the system can be interconnected by any form or medium of digitaldata communication, e.g., a communication network. Examples ofcommunication networks include a local area network (“LAN”) and a widearea network (“WAN”), e.g., the Internet, a 3G network, an ISM bandradio network, or other networks.

The computing system can include clients and servers. A client andserver are generally remote from each other and typically interactthrough a communication network. The relationship of client and serverarises by virtue of computer programs running on the respectivecomputers and having a client-server relationship to each other.

While this specification contains many specific implementation details,these should not be construed as limitations on the scope of what may beclaimed, but rather as descriptions of features that may be specific toparticular embodiments. Certain features that are described in thisspecification in the context of separate embodiments can also beimplemented in combination in a single embodiment. Conversely, variousfeatures that are described in the context of a single embodiment canalso be implemented in multiple embodiments separately or in anysuitable subcombination. Moreover, although features may be describedabove as acting in certain combinations and even initially claimed assuch, one or more features from a claimed combination can in some casesbe excised from the combination, and the claimed combination may bedirected to a subcombination or variation of a subcombination.

Similarly, while operations are depicted in the drawings in a particularorder, this should not be understood as requiring that such operationsbe performed in the particular order shown or in sequential order, orthat all illustrated operations be performed, to achieve desirableresults. In certain circumstances, multitasking and parallel processingmay be advantageous. Moreover, the separation of various systemcomponents in the embodiments described above should not be understoodas requiring such separation in all embodiments, and it should beunderstood that the described program components and systems cangenerally be integrated together in a single software product orpackaged into multiple software products.

Particular embodiments of the subject matter have been described. Otherembodiments are within the scope of the following claims. For example,the actions recited in the claims can be performed in a different orderand still achieve desirable results. As one example, the processesdepicted in the accompanying figures do not necessarily require theparticular order shown, or sequential order, to achieve desirableresults. In certain implementations, multitasking and parallelprocessing may be advantageous. Other steps may be provided, or stepsmay be eliminated, from the described processes. Accordingly, otherimplementations are within the scope of the following claims.

1.-30. (canceled)
 31. A server system that controls water to bedispensed at water supply outlets to end users at distributed geographiclocations, the server system comprising: a memory configured to storeaccount data, the account data comprising: an identifier that identifiesa remote supply outlet for dispensing a resource; and credit dataspecifying an amount of the resource that is available for dispensing atthe remote supply outlet; and one or more processors configured toperform operations comprising: receiving update data indicative of achange to particular credit data for a particular remote supply outlet,the update data including a particular identifier identifying theparticular remote supply outlet; accessing the memory to determine aparticular amount of the resource that is available to dispense at theparticular remote supply outlet; and sending data to the particularremote supply outlet specifying the particular amount of the resourcethat is available to enable the particular remote supply outlet todispense that particular amount of the resource.
 32. The server systemof claim 31, the operations further comprising: receiving payment datafrom a remote client device, the payment data being associated with theparticular identifier, the payment data specifying a payment amount; andupdating, based on the payment amount, the particular credit dataassociated with the particular remote supply outlet identified by theparticular identifier.
 33. The server system of claim 32, the operationsfurther comprising: in response to receiving the payment data from theremote client device, determining, based on the payment data, a givenamount of the resource to credit to the particular remote supply outlet,the given amount based on a pricing function that specifies the givenamount of the resource for a monetary amount specified in the pricingfunction; and updating the credit data based on the given amount of theresource.
 34. The server system of claim 32, wherein the remote clientdevice comprises a mobile phone, and wherein the remote supply outletcomprises a water meter.
 35. The server system of claim 31, wherein theoperations further comprise: receiving usage data specifying a dispensedamount of the resource that is dispensed at the particular remote supplyoutlet and a time stamp specifying when the resource is dispensed;determining, based on the time stamp, a pricing function specifying amonetary amount for the amount of the resource; and reducing aparticular credit associated with the particular remote supply outletbased on the pricing function and the usage data.
 36. The server systemof claim 31, wherein the update data are received using a short messageservice (SMS) format, a Transmission Control Protocol/Internet Protocol(TCP/IP) message, or an unstructured supplementary service data (USSD)message.
 37. The server system of claim 31, wherein the particularidentifier is associated with a single remote supply output.
 38. Theserver system of claim 31, wherein the particular identifier isassociated with multiple remote supply outputs.
 39. The server system ofclaim 31, wherein the one or more processors are included in a cloudcomputing platform.
 40. The server system of claim 31, the operationsfurther comprising: receiving a usage request, from a remote clientdevice, querying the particular amount of the resource that is availableassociated with the particular identifier; and sending, in response tothe usage request, data specifying the particular amount of the resourcethat is available.
 41. A device configured for dispensing a resource,the device comprising: a flow meter configured to measure an amount ofthe resource being dispensed and generate data representing the amountof the resource; a valve configured to control dispensing of theresource; and one or more processing devices configured to receive thedata representing the amount of the resource and control operation ofthe valve, the one or more processing devices configured to performoperations comprising: receiving, from a remote computing system, creditdata specifying an available amount of the resource that is availablefor dispensing by the valve; and controlling, based on the availableamount of the resource, the valve to open to enable a particular amountof the resource to be dispensed.
 42. The device of claim 41, theoperations further comprising: periodically updating a value specifyinga dispensed amount of the resource including the particular amount; andsending the data including the value specifying a dispensed amount tothe remote computing system to cause the remote computing system toupdate the credit data at the remote computing system.
 43. The device ofclaim 41, further comprising a transceiver for sending data to andreceiving data from the remote computing system.
 44. The device of claim43, wherein the transceiver is configured to operate using a mobilecommunications network or a radio network.
 45. The device of claim 41,wherein controlling the valve to open to enable the particular amount ofthe resource to be dispensed occurs when the particular amount of theresource is less than the available amount of the resource.
 46. Thedevice of claim 41, wherein controlling, based on the available amountof the resource, the valve to open to enable a particular amount of theresource to be dispensed occurs independent of a user interacting with auser interface of the device.
 47. The device of claim 41, wherein theremote computing system comprises a server system, and wherein the oneor more processing devices are configured to send data to or receivedata from the server system at in response to a change in a credit or adebit amount independent of controlling the valve to open to enable theparticular amount of the resource to be dispensed.